home *** CD-ROM | disk | FTP | other *** search
/ Gekikoh Dennoh Club 1 / Gekikoh Dennoh Club Vol. 1 (Japan).7z / Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin / kowin / archive / sys / kowin14d.lzh / include / sys_doslib.h < prev    next >
C/C++ Source or Header  |  1995-03-24  |  7KB  |  271 lines

  1. /*   System inline DOSCALL header 1993 by H.Ogasawara (COR.)    */
  2.  
  3. #ifndef    __dos_inline_call__
  4. #define    __dos_inline_call__
  5.  
  6. /* ff00 */
  7. DOSCALL    volatile void    EXIT(void);
  8. DOSCALL    int        GETCHAR(void);
  9. DOSCALL    void        PUTCHAR(unsigned short);
  10. DOSCALL    int        COMINP(void);
  11. DOSCALL    void        COMOUT(unsigned short);
  12. DOSCALL    void        PRNOUT(unsigned short);
  13. DOSCALL    int        INPOUT(unsigned short);
  14. DOSCALL    int        INKEY(void);
  15. /* ff08 */
  16. DOSCALL    int        GETC(void);
  17. DOSCALL    void        PRINT(const char *);
  18. DOSCALL    int        GETS(char *);
  19. DOSCALL    int        KEYSNS(void);
  20. /*DOSCALL int        KFLUSH(unsigned short,...);*/
  21. DOSCALL    void        FFLUSH(void);
  22. DOSCALL    int        CHGDRV(unsigned short);
  23. DOSCALL    int        DRVCTRL(unsigned short);
  24. /* ff10 */
  25. DOSCALL    int        CONSNS(void);
  26. DOSCALL    int        PRNSNS(void);
  27. DOSCALL    int        CINSNS(void);
  28. DOSCALL    int        COUTSNS(void);
  29. /*DOSCALL 14*/
  30. /*DOSCALL 15*/
  31. /*DOSCALL 16*/
  32. DOSCALL    int        FATCHK(const char *fname, char *buf);
  33. /* ff18 */
  34. /*DOSCALL int        HENDSP(short,...);*/
  35. DOSCALL    int        CURDRV(void);
  36. DOSCALL    int        GETSS(char *);
  37. DOSCALL    int        FGETC(short);
  38. DOSCALL    int        FGETS(char *,short);
  39. DOSCALL    int        FPUTC(short, short);
  40. DOSCALL    int        FPUTS(char *,short);
  41. DOSCALL    void        ALLCLOSE(void);
  42. /* ff20 */
  43. DOSCALL int        SUPER(int);    /* Caution!! */
  44. DOSCALL    void        FNCKEY(unsigned short,char*);
  45. #define    FNCKEYGT(a,b)    FNCKEY(a,b)
  46. #define    FNCKEYST(a,b)    FNCKEY((a)+256,b)
  47. /*DOSCALL int        KNJCTRL(unsigned short,...);*/
  48. /*DOSCALL int        CONCTRL(unsigned short,...);*/
  49.  
  50. asm( "CONCTRLs    equ    CONCTRL" );
  51. asm( "CONCTRLss    equ    CONCTRL" );
  52. asm( "CONCTRLsss equ    CONCTRL" );
  53. DOSCALL    int        CONCTRLs(unsigned short);
  54. DOSCALL    int        CONCTRLss(unsigned short, unsigned short);
  55. DOSCALL    int          CONCTRLsss(unsigned short,unsigned short,unsigned short);
  56. #define    C_CLS_AL()    CONCTRLss(10,2)
  57. #define    C_FNKMOD(a)    CONCTRLss(14,a)
  58. #define    C_WINDOW(a,b)    CONCTRLsss(15,a,b)
  59. #define    C_WIDTH(a)    CONCTRLss(16,a)
  60. #define    C_CURON()    CONCTRLs(17)
  61. #define    C_CUROFF()    CONCTRLs(18)
  62.  
  63. /*DOSCALL int        KEYCTRL(unsigned short,...);*/
  64. asm( "KEYCTRLs    equ    KEYCTRL" );
  65. DOSCALL    int        KEYCTRLs( unsigned short );
  66. #define    K_SFTSNS()    KEYCTRLs(2)
  67.  
  68. DOSCALL    int        INTVCS(unsigned short, void *);
  69. DOSCALL    void        PSPSET(void *);
  70. DOSCALL    int        GETTIME2(void);
  71. /* ff28 */
  72. DOSCALL    int        SETTIME2(int);
  73. DOSCALL    int        NAMESTS(char *,char *);
  74. DOSCALL    int        GETDATE(void);
  75. DOSCALL    int        SETDATE(unsigned short);
  76. DOSCALL    unsigned short    GETTIME(void);
  77. DOSCALL    int        SETTIME(unsigned short);
  78. DOSCALL    void        VERIFY(unsigned short);
  79. DOSCALL    int        DUP0(short,short);
  80. /* ff30 */
  81. DOSCALL    const int    VERNUM(void);
  82. DOSCALL    volatile void    KEEPPR(int,short);
  83. DOSCALL    int        GETDPB(unsigned short,void *);
  84. DOSCALL    int        BREAKCK(unsigned short);
  85. DOSCALL    int        DRVXCHG(short,short);
  86. DOSCALL    int        INTVCG(unsigned short);
  87. DOSCALL    int        DSKFRE(unsigned short,void *);
  88. DOSCALL    int        NAMECK(const char*, void *);
  89. /* ff38 */
  90. /*DOSCALL 38*/
  91. DOSCALL    int        MKDIR(const char*);
  92. DOSCALL    int        RMDIR(const char*);
  93. DOSCALL    int        CHDIR(const char*);
  94. DOSCALL    int        CREATE(const char*,short);
  95. DOSCALL    int        OPEN(const char*,short);
  96. DOSCALL    int        CLOSE(short);
  97. DOSCALL    int        READ(short,void *,int);
  98. /* ff40 */
  99. DOSCALL    int        WRITE(short,void *,int);
  100. DOSCALL    int        DELETE(const char*);
  101. DOSCALL    int        SEEK(short,int,short);
  102. DOSCALL    int        CHMOD(const char*,short);
  103. /*DOSCALL int        IOCTRL(short,...);*/
  104. DOSCALL    int        DUP(short);
  105. DOSCALL    int        DUP2(short,short);
  106. DOSCALL    int        CURDIR(short,char *);
  107. /* ff48 */
  108. DOSCALL    void        *MALLOC(int);
  109. DOSCALL    int        MFREE(void*);
  110. DOSCALL    int        SETBLOCK(void*,int);
  111. /*DOSCALL int        EXEC(short,...);*/
  112.  
  113. asm( "EXECsss    equ    EXEC" );
  114. DOSCALL    int        EXECsss( unsigned short, void*, void*, void* );
  115. #define    PATHCHK( a, b, c )    EXECsss( 2, a, b, c )
  116. /*#define    LOADEXEC( a, b, c )    EXECsss( 0, a, b, c )*/
  117.  
  118. DOSCALL    volatile void    EXIT2(short);
  119. DOSCALL    int        WAIT(void);
  120. DOSCALL    int        FILES(void*,const char*,short);
  121. DOSCALL    int        NFILES(void*);
  122. /* ff50 */
  123. DOSCALL    int        SETPDB(int);
  124. DOSCALL    int        GETPDB(void);
  125. DOSCALL    int        SETENV(const char*,void *,char *);
  126. DOSCALL    int        GETENV(const char*,void *,char *);
  127. DOSCALL    int        VERIFYG(void);
  128. /*DOSCALL int        COMMON(short,...);*/
  129. DOSCALL    int        RENAME(const char *, const char *);
  130. DOSCALL    unsigned int    FILEDATE(short,unsigned int);
  131. /* ff58 */
  132. DOSCALL    int        MALLOC2(int);
  133. /*DOSCALL 59*/
  134. DOSCALL    int        MAKETMP(char *,short);
  135. DOSCALL    int        NEWFILE(const char *,short);
  136. DOSCALL    int        LOCK(short,short,int,int);
  137. /*DOSCALL 5d*/
  138. /*DOSCALL 5e*/
  139. /*DOSCALL int        ASSIGN(short,...);*/
  140.  
  141. /* ff7c */
  142. DOSCALL    void        *GETFCB(short);
  143. DOSCALL    int        S_MALLOC(short,int);
  144. DOSCALL    int        S_MFREE(int);
  145. DOSCALL    int        S_PROCESS(short,void*,int,int);
  146.  
  147. /* fff0 */
  148. /*DOSCALL int        EXITVC();*/
  149. /*DOSCALL int        CTRLVC();*/
  150. /*DOSCALL int        ERRJVC();*/
  151. DOSCALL    void        DISKRED(char*,short,short,short);
  152. DOSCALL    void        DISKWRT(char*,short,short,short);
  153. DOSCALL    int        INDOSFLG(void);
  154. DOSCALL    int        SUPER_JSR(void*);
  155. DOSCALL    int        BUS_ERR(void*,void*,short);
  156. /* fff8 */
  157. DOSCALL    int        OPEN_PR(char*,short,int,int,short,void*,void*,int);
  158. DOSCALL    void        KILL_PR(void);
  159. DOSCALL    int        GET_PR(short,void*);
  160. DOSCALL    int        SUSPEND(short);
  161. DOSCALL    int        SLEEP_PR(int);
  162. DOSCALL    int        SEND_PR(short,short,short,void*,int);
  163. DOSCALL    int        TIME_PR(void);
  164. DOSCALL    void        CHANGE_PR(void);
  165.  
  166. #endif
  167.  
  168. #ifndef    __float_inline_call__
  169. #define    __float_inline_call__
  170. /* fe00 */
  171. asm( "RAND    equ    $fe0e" );
  172. DOSCALL    int        RAND(void);
  173. #endif
  174.  
  175. #ifndef    __dos_lib__
  176. #define    __dos_lib__
  177.  
  178. struct PDBADR {
  179.     unsigned int    env,        /* 0 */
  180.             exit,        /* 4 */
  181.             ctrlc,        /* 8 */
  182.             errexit,    /* 12 */
  183.             comline;    /* 16 */
  184.     unsigned char    handle[12];
  185.     unsigned int    bss,
  186.             heap,
  187.             stack,
  188.             usp,
  189.             ssp;
  190.     unsigned short    sr,
  191.             abort_sr;
  192.     unsigned int    abort_ssp,
  193.             trap10,
  194.             trap11,
  195.             trap12,
  196.             trap13,
  197.             trap14,
  198.             osflg;
  199.     unsigned char    reserve[28],
  200.             exe_path[68],
  201.             exe_name[24];
  202.     };
  203.  
  204. struct INPPTR {
  205.     unsigned char     max,
  206.             length,
  207.             buffer[256];
  208.     };
  209.  
  210. struct COMLINE {
  211.     unsigned char     len,
  212.             buffer[255];
  213.     };
  214.  
  215. struct NAMESTBUF {
  216.     unsigned char    flg,
  217.             drive;
  218.     unsigned char    path[65],
  219.             name1[8],
  220.             ext[3],
  221.             name2[10];
  222.     };
  223.  
  224. struct FREEINF {
  225.     unsigned short    free,
  226.             max,
  227.             sec,
  228.             byte;
  229.     };
  230.  
  231. struct NAMECKBUF {
  232.     unsigned char    drive[2],
  233.             path[65],
  234.             name[19],
  235.             ext[5];
  236.     };
  237.  
  238. struct DPBPTR {
  239.     unsigned char    drive,
  240.             unit;
  241.     unsigned short    byte;
  242.     unsigned char    sec,
  243.             shift;
  244.     unsigned short    fatsec;
  245.     unsigned char    fatcount,
  246.             fatlen;
  247.     unsigned short    dircount,
  248.             datasec,
  249.             maxfat,
  250.             dirsec;
  251.     int        driver;
  252.     unsigned char    id,
  253.             flg;
  254.     struct DPBPTR    *next;
  255.     unsigned short    dirfat;
  256.     unsigned char    dirbuf[64];
  257. };
  258.  
  259. struct FILBUF {
  260.     unsigned char    os[21],
  261.             atr;
  262.     unsigned short    time,
  263.             date;
  264.     unsigned int    filelen;
  265.     unsigned char    name[23];
  266. };
  267.  
  268. #endif
  269.  
  270. /* :vi:se ts=8 sw=8: */
  271.